# -*- coding: utf-8 -*-
"""
Created by edc on 2020/7/31
"""
# 引入MinIO包。
from minio import Minio

# 使用endpoint、access key和secret key来初始化minioClient对象。
minioClient = Minio('172.16.2.116:29000',
                    access_key='AKIAIOSFODNN7EXAMPLE',
                    secret_key='wJalrXUtnFEMIGK7MDENGFFbPxRfiCYEXAMPLEKEY',
                    secure=False
                    )

# 调用make_bucket来创建一个存储桶。

# minioClient.make_bucket("deeplearn", location='cn-north-1')

#如果有相同名称的对象，则覆盖
minioClient.fput_object(bucket_name='deeplearn', object_name='get.docker.sh', file_path='/root/gpgkey')
# minioClient.fget_object(bucket_name='deeplearn', object_name='get-docker.sh', file_path='/root/get-do')
